package com.jsn.exception;


import com.jsn.responseEntity.CommonCode;

public class CommonException extends RuntimeException {

    public Integer code;

    public String msg;

    public CommonException(Integer code, String msg) {
        super(msg);
        this.code = code;
        this.msg = msg;
    }

    public CommonException(String msg) {
        super(msg);
        this.code = CommonCode.COMMON_FAIL.code();
        this.msg = msg;
    }

    public CommonException() {
        super(CommonCode.COMMON_FAIL.message());
        this.code = CommonCode.COMMON_FAIL.code();
        this.msg = CommonCode.COMMON_FAIL.message();
    }
    public CommonException(CommonCode status) {
        super(status.message());
        this.code = status.code();
        this.msg = status.message();
    }

    public CommonException(Throwable cause) {
        super(cause);
    }


}
